import cpRequest from '..'
import type { ILoginState } from '@/types'

export function login(data: ILoginState) {
  return cpRequest.post({
    url: '/login',
    data
  })
}
export function getUserInfoById(id: number) {
  return cpRequest.get({
    url: `/users/${id}`
  })
}

export function getUserMenusByRoleId(id: number) {
  return cpRequest.get({
    url: `/role/${id}/menu`
  })
}
